<?php 

class Login_model{

	private $db;

	function __construct(){
		require_once('cruds.php');
		
		$this->db = new CRUDS();
	}
	
	function check_nip($nip, $pass){
		$this->db->select('*');
		$this->db->from('biodata');
		$this->db->inner_join('role', 'role.ID_ROLE = biodata.ID_ROLE');
		$this->db->where("NIP = '".$nip."' AND PASSWORD_PEGAWAI = '".($pass)."'");
		
		$query = $this->db->get();//echo $query;
		return $query;
	}
	
	
}

?>